package com.yljk.mydoctor.adapter;

import android.net.Uri;
import android.view.View;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yljk.mydoctor.R;
import com.yljk.mydoctor.entity.MineListBean;

import java.util.ArrayList;
import java.util.List;

public
class MineListAdapter extends BaseQuickAdapter<MineListBean, BaseViewHolder> {
    ArrayList<MineListBean> data = new ArrayList<>();
    public MineListAdapter(int layoutResId, @Nullable List<MineListBean> data) {
        super(layoutResId, data);
        this.data.addAll(data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MineListBean item) {
        helper.setVisible(R.id.mine_list_point,item.isShowPoint());
        helper.setText(R.id.mine_user_info_item_title, item.getTitles());
        helper.setText(R.id.mine_list_detail, item.getDescription());
        ImageView view = helper.getView(R.id.mine_user_info_item_image);
        Glide.with(mContext).load(Uri.parse(item.getImages())).into(view);
//        Picasso.with(mContext).load(Uri.parse(item.getImages())).into(view);
        if (item.getId() == 1501){
            ImageView mine_list_right = helper.getView(R.id.mine_list_right);
            mine_list_right.setVisibility(View.INVISIBLE);
        }else{
            ImageView mine_list_right = helper.getView(R.id.mine_list_right);
            mine_list_right.setVisibility(View.VISIBLE);
        }
    }

}
